1. Field of the Invention
The present invention relates to an image processing method and an image processing apparatus, and also to a recording medium.
2. Description of the Related Art
To obtain a high-quality image from image data when it is output from a printer or a display unit, it is necessary to perform color processing, such as color correction, color conversion, binary-quantizing processing, etc., according to the type of object, on each of a plurality of objects forming the image. Generally, to print or display an image created by a computer application to a printer or on a display unit, a device driver or a device forms an image from a group of drawing commands output from the application and generates image data of the whole page.
A drawing command group forming a document is issued to a device driver according to the type of data, such as, image drawing commands issued for photographs, text drawing commands output for text, and graphics drawing commands issued for graphics. Then, the device driver performs color processing suitable for the object according to the type of command and converts the data into an image of the form which can be output by the output device.
In this case, color-matching processing can be switched according to the type of data, such as saturation color processing for graphics, calorimetric processing for text, and perceptual color processing for photographs, thereby achieving a high quality output on all the objects of the whole page.
By utilizing a certain type of system and application, it has become possible to specify a source color space for the objects, enabling the device driver to perform color processing by using the specified source color space, resulting in a higher quality output. More specifically, for example, when an image input by a scanner is pasted in a document, a color profile indicating the device characteristics of the scanner is specified for the corresponding image drawing commands. Or, when color calibration is performed on a display unit, a color profile indicating the characteristics of the monitor used can be designated to reproduce the color viewed by the editor. The above-mentioned color profiles are, for example, International Color Consortium (ICC) profiles, which can be used by the system, such as the Windows ICM system of Microsoft Corporation, or the ColorSync system of Apple Computer Inc.
However, even by the use of such a precise color-matching processing system, if an original photographic image is a poor quality, a high quality and aesthetically pleasant image cannot be expected. For example, in a conventional system, if an image photographed by a digital camera, which is coming into widespread use, is unsuitably exposed, the resulting image faithfully reflects the unsuitably exposed image when it is printed, thereby failing to achieve an image of a very good quality. In order to overcome such a drawback, a user performs image correction, such as nonlinear color balance processing, for correcting the inappropriate exposure of the document image, on the whole document image by using, for example, image retouching software. However, the user without a good knowledge and experience in the corresponding operation has to depend on trial-and-error methods in order to set a suitable correcting operation, which is very time-consuming.
Additionally, concerning already printed document data, such as a DTP document pasted with an uncorrected photograph, the following complicated operation is necessary to conduct image correction only on the photograph portion of the document image. That is, an image portion should be first designated and cut from the document image, and then corrected by using the image retouching software, and again pasted in the document image.
In a comparatively high-end application which aims to optimize the efficiency in using the memory and the processing rate, a large image, such as that shown in FIG. 8, may sometimes be internally divided and processed by a plurality of image drawing commands. This type of processing is often executed in, for example, the Adobe PhotoShop v4.0 application.
Thus, if the operation for determining conditions for performing color processing, for example, for correcting the exposure of the document image, according to the color distribution of the document image, is conducted on each of the divided object images, the following problem arises. Color processing conditions are set for each of the different parts which have been internally divided from a single original image by using an application. This may disadvantageously disturb the continuity of color at the interfaces of the parts.
It is also necessary to analyze the color distribution of the original image for automatically setting image-correction processing, such as nonlinear color balancing for correcting the exposure of the original image. Conventionally, to increase the processing rate, image data is sampled according to predetermined sampling conditions regardless of the image conditions. However, by using this conventional method in current systems for inputting various sizes of image data, a sufficient number of samples of image data is not provided, thereby failing to set optimal processing conditions, or an excessively large number of samples of image data is provided, thereby increasing the processing time. That is, according to the conventional method, optimal processing conditions cannot be efficiently set.